/**
 * @file       godemool/error.h
 * @brief      error exception.
 * @author     ben "boin" bonoeil
 * @date       2015-02
 */

/* Copyright (c) 2007-2015, ben "boin" bonoeil */

#ifndef GODEMOOL_ERROR_H
#define GODEMOOL_ERROR_H

#include <string>

namespace boin { struct Error; }
  
struct boin::Error
{
  enum Num { ok, error, args, system, input, output, last } num;

  std::string msg;

  Error(Num number, const char * what = nullptr);
  Error(Num number, const std::string & what);
  static const char * Str(Num number);
  operator const std::string & () const { return msg; }
  operator const char * () const { return msg.c_str(); }
  operator unsigned int () const { return num; }
};

#endif

/* Local Variables:  */
/* mode: c++         */
/* End:              */
